import unittest


class Demo1TestCase(unittest.TestCase):
    def test1(self):
        print('test1')

    def test2(self):
        print('test2')


class Demo2TestCase(unittest.TestCase):
    def testa(self):
        print('testa')

    def testb(self):
        print('testb')


if __name__ == '__main__':
    # 普通执行方式
    # unittest.main(verbosity=2)
    # TODO suite 测试套件
    # TODO addTest 加载测试方法的顺序，就是执行的顺序
    '''
    # suite
    suite = unittest.TestSuite()
    suite.addTest(Demo1TestCase('test1'))
    suite.addTest(Demo1TestCase('test2'))
    suite.addTest(Demo2TestCase('testa'))
    '''
    # TODO addTests
    '''
    # suite
    suite = unittest.TestSuite()
    tests = [
        Demo1TestCase('test1'),
        Demo1TestCase('test2'),
        Demo2TestCase('testa')
    ]
    # for test in tests:
    #     suite.addTest(test)
    suite.addTests(tests)
    '''
    # todo runner 执行器，创建执行对象
    # runner = unittest.TextTestRunner(verbosity=2)
    # runner.run(suite)
